package com.tanhua.sso.controller;

import cn.hutool.core.convert.Convert;
import com.tanhua.sso.service.SmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/user")
@Slf4j
public class SmsController {

    @Autowired
    private SmsService smsService;

    @PostMapping("/login")
    public Object sendCheckNum(@RequestBody Map<String, String> params) {
        String phoneNum = Convert.toStr(params.get("phone"));
        return smsService.sendCheckNum(phoneNum);
    }
}
